<template>
  <div>
    <el-form-item
      label="显示条数"
      prop="notice.xsts"
    >
      <el-input-number v-model="form.notice.xsts" :min="1" style="width: 180px" />
    </el-form-item>
    <el-form-item label="更多查询地址" prop="notice.moreUrl">
      <el-input
        v-model="form.notice.moreUrl"
        placeholder="请输入更多查询地址"
        style="width: 500px"
      />
    </el-form-item>
  </div>
</template>
<script>
import notice from '@/api/system/notice'
export default {
  name: 'ComponentNotice',
  props: {
    form: {
      type: Object,
      require: true
    }
  },
  data() {
    return {
      rules: {
        columnName: [
          { required: true, message: '请输入栏目名称', trigger: 'blur' }
        ],
        icon: [
          { required: true, message: '栏目图标不能为空', trigger: 'blur' }
        ],
        notice: {
          xsts: [
            { required: true, message: '显示条数不能为空', trigger: 'blur' }
          ]
        }
      }
    }
  },
  mounted() {
    this.$emit('getRules', this.rules)
    const id = this.form.id
    if (id != null) {
      notice.queryComponent(id).then(res => {
        this.form.notice = res
        this.form.notice.isMore = this.form.notice.isMore.toString()
      }).catch(error => {
        console.log(error)
      })
    }
  },
  dicts: ['whether_type']
}
</script>

<style scoped>

</style>
